#include <cstdio>
#include <algorithm>

using namespace std;

const int MAX = 1000 + 10;

struct mooncake {
	double store;  // 库存
	double total_price;  // 总售价
	double price;  // 单价
}cake[MAX];

bool cmp(mooncake a, mooncake b) {
	return a.price > b.price;
}

int main() {
	int N;
	double D;
	double sum = 0.0;
	scanf("%d%lf", &N, &D);

	for (int i = 0; i < N; i++) {
		scanf("%lf", &cake[i].store);
	}
	for (int i = 0; i < N; i++) {
		scanf("%lf", &cake[i].total_price);
		cake[i].price = cake[i].total_price / cake[i].store;
	}

	sort(cake, cake+N, cmp);

	for (int i = 0; i < N; i++) {
		if (cake[i].store < D) {
			D -= cake[i].store;
			sum += cake[i].total_price;
		} else {
			sum += D * cake[i].price;
			break;
		}
	}

	printf("%.2f\n", sum);

}

